package com.cwj.user.controller;

import com.cwj.common.vo.Result;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.ServletContext;

@RestController
public class UrlController {
    @Resource
    private ServletContext servletContext;
    @Resource
    private StringRedisTemplate stringRedisTemplate;
    @PostMapping("/GetUserUrl")
    public Result GetUserUrl(){
        Object userUrl = servletContext.getAttribute("UserUrl");
        return Result.normal(userUrl,null);
    }
    @PostMapping("/GetFilmUrl")
    public Result GetFilmUrl(){
        String FilmUrl=stringRedisTemplate.opsForValue().get("FilmUrl");
        return Result.normal(FilmUrl,null);
    }
}
